<?php
App::import('Html',"html");
App::import('Form',"form");
App::import('Session',"session");

class AppController extends Controller {

	public $components = array(
        'Acl',
        'Auth' => array(
            'authenticate' => array(
                'Form' => array(
                    'fields' => array('username' => 'email'),
                    'scope'  => array('User.status' => 1)
                )
            ),
            'authorize' => array(
                'Actions' => array('actionPath' => 'controllers')
            )
        ),
        'Session'
    );
    
    
	public function beforeFilter() {
	     parent::beforeFilter();
	      
//			$this->Auth->allow();//must comment after generate action
	 
	     //Configure AuthComponent
	     $this->Auth->loginAction = '/users/login';
	     $this->Auth->logoutRedirect = '/users/login';
	     $this->Auth->loginRedirect = array('plugin'=>false,
	            'controller' => 'admins', 'action' => 'index');  
	 }
}
?>